package com.songshuai.webapi.permission;

import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import com.songshuai.webapi.baseapi.utils.SpringContextUtil;
import org.apache.commons.lang3.time.StopWatch;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import java.text.SimpleDateFormat;
import java.util.Date;

@EnableEurekaClient
//@EnableFeignClients
@EnableHystrix
@SpringBootApplication
@EnableHystrixDashboard
@EnableApolloConfig
public class PermissionApplication {

    public static void main(String[] args) {
        StopWatch sw = new StopWatch();
        sw.start();
        System.setProperty("apollo.configService", "http://118.25.41.11:8080");
        ConfigurableApplicationContext applicationContext = SpringApplication.run(PermissionApplication.class, args);
        SpringContextUtil.setApplicationContext(applicationContext);
        System.out.println(new SimpleDateFormat("[yyyy-MM-dd HH:mm:ss]").format(new Date())
                + "PermissionApplication server started!");
        sw.stop();
        System.out.println("PermissionApplication Launch Time: " + sw.toString());
    }
}
